#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QtNetwork/QNetworkAccessManager>

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

private slots:
    void OnTranslateBtnClicked();
    void OnTranslateDataReturn(QNetworkReply*);
    void OnSwapLanguageBtnClicked();

private:
    Ui::MainWindow *ui;
    void TranslateText();
    QString GetDestinationTextFromJson(QByteArray);
    void InitLanguageComboBoxs();
    QString GetCurSrcLanguage();
    QString GetCurDstLanguage();
    void SwapSrcDstLanguage();
    void keyPressEvent(QKeyEvent *event);
    void SwitchWindowShow();

};
#endif // MAINWINDOW_H
